Apparatus and method for encoding and decoding moving picture using adaptive scanning

ABSTRACT

Provided is an apparatus and method for encoding/decoding a moving picture based on adaptive scanning. The moving picture apparatus and method can increase a compression rate based on adaptive scanning by performing intra prediction onto blocks of a predetermined size, and scanning coefficients acquired from Discrete Cosine Transform (DCT) of a residue signal and quantization differently according to the intra prediction mode. The moving picture encoding apparatus includes: a mode selector for selecting and outputting a prediction mode; a predictor for predicting pixel values of pixels to be encoded of an input video based on the prediction mode to thereby output a residue signal block; a transform/quantization unit for performing DCT onto the residue signal block and quantizing the transformed residue signal block; and an encoder for adaptively scanning and encoding the quantized residue signal block based on the prediction mode.

CROSS-REFERENCE TO RELATED APPLICATIONS

This is a continuation of application Ser. No. 13/469,536 filed on May11, 2012, which is a continuation of application Ser. No. 12/090,699filed on Apr. 18, 2008, now U.S. Pat. No. 8,199,819, which is a U.S.national stage application of International Application No.PCT/KR2006/004260 filed on Oct. 19, 2006, which claims the benefit ofKorean Application No. 10-2005-0099733 filed on Oct. 21, 2005, in theKorean Intellectual Property Office. The disclosures of application Ser.Nos. 13/469,536 and 12/090,699, International Application No.PCT/KR2006/004260, and Korean Application No. 10-2005-0099733 areincorporated herein by reference in their entirety for all purposes.

TECHNICAL FIELD

The present invention relates to encoding and decoding of a movingpicture based on adaptive scanning; and, more particularly, to a movingpicture encoding/decoding apparatus that can increase a compression rateby performing intra prediction onto blocks of a predetermined size, andadaptively scanning coefficients acquired from Discrete Cosine Transform(DCT) of a residue signal and quantization differently according to theintra prediction mode, and a method thereof.

BACKGROUND ART

According to an H.264 standard arranged for encoding/decoding a movingpicture, the encoding/decoding is performed on the basis of a unit ofmacro blocks or a unit of a sub-block. One frame includes a plurality ofmacro blocks, and the sub-block is acquired by dividing a macro blockinto two or four sub-blocks. The encoding and decoding are carried outbased on temporal prediction and spatial prediction. Temporal predictionis predicting motion of the macro blocks of a current frame by referringto macro blocks of adjacent frames. Spatial prediction is predicting amacro block of a current frame to be encoded based on adjacent macroblocks within the current frame.

The spatial prediction is also referred to as intra prediction. Theintra predication takes advantage of a feature that adjacent pixels of apixel to be predicted is highly likely to have a similar value.According to the H.264 standard, a pixel value of a current block ispredicted based on a prediction mode considering nine directionalities.

FIG. 1 is a view showing an intra prediction mode for 4×4 blocks and 8×8blocks in the H.264 standard. There are nine prediction modes accordingto the prediction direction: a vertical mode (mode 0), a horizontal mode(mode 1), a DC mode (mode 2), a Diagonal_Down_Left mode (mode 3), aDiagonal_Down_Right mode (mode 4), a Vertical_Right mode (mode 5), aHorizontal_Down mode (mode 6), a Vertical_Left mode (mode 7), and aHorizontal_Up mode (mode 8). The arrows signify prediction directions.Hereinafter, a prediction process in the vertical mode and thehorizontal mode when intra prediction is performed onto 4×4 blocks willbe described.

FIG. 2 is a view for describing a pixel prediction process in thevertical mode performed onto 4×4 blocks 300. As shown in FIG. 2, pixelsa, e, i, and m 302, 304, 306 and 308 are predicted from an adjacentpixel A in the vertical direction. In the same way, pixels b, f, j and nare predicted from a pixel B, and pixels c, g, k and o are predictedfrom a pixel C, while pixels d, h, l and p are predicted from a pixel D.

FIG. 3 is a view for describing a pixel prediction process in thehorizontal mode performed onto 4×4 blocks 300. As shown in FIG. 3,pixels a, b, c and d 312, 314, 316 and 318 are predicted from anadjacent pixel I in the horizontal direction. In the same way, pixels e,f, g and h are predicted from a pixel J, and i, j, k and l are predictedfrom a pixel K pixels, while pixels m, n, o and p are predicted from apixel L.

Meanwhile, a conventional moving picture encoder performs entropyencoding by performing Discrete Cosine Transform (DCT) and quantizationonto a residue signal, which is obtained by differentially dividing apredicted signal and a current signal, to thereby produce coefficientsand performing zigzag scanning onto the coefficients.

However, the correlation of the residue signal is likely to be high in ahorizontal direction or a vertical direction according to whether theprediction mode is a horizontal mode or a vertical mode. Therefore, theconventional encoding method using a fixed zigzag scanning has adrawback that it is not appropriate for acquiring a high compressionrate.

DISCLOSURE Technical Problem

It is, therefore, an object of the present invention to provide a movingpicture encoding apparatus and method that can increase a compressionrate based on adaptive scanning by performing intra prediction ontoblocks of a predetermined size, and adaptively scanning coefficientsacquired from Discrete Cosine Transform (DCT) of a residue signal andquantization according to the intra prediction mode, and a decodingapparatus and method therefor.

Technical Solution

In accordance with one aspect of the present invention, there isprovided an apparatus for encoding a moving picture based on adaptivescanning, which includes: a mode selecting means for selecting andoutputting a prediction mode; a predicting means for predicting pixelvalues of pixels to be encoded of an input video based on the predictionmode to thereby output a residue signal block; a transform/quantizationmeans for performing Discrete Cosine Transform (DCT) onto the residuesignal block and quantizing the transformed residue signal block; and anencoding means for adaptively scanning and encoding the quantizedresidue signal block based on the prediction mode.

In accordance with another aspect of the present invention, there isprovided an apparatus for decoding a moving picture based on adaptivescanning, which includes: an entropy decoder for receiving encodedbitstream, decoding the encoded bitstream based on an entropy decodingmethod, and outputting decoded signals; a scanning method detector forreceiving the decoded signals from the entropy decoder, acquiring ascanning method used in the encoding of the decoded signals, andoutputting the scanning method information along with the decodedsignals; and a video recovering unit for recovering the decoded signalsbased on the scanning method and outputting a recovered video, whereinthe scanning method is an adaptive scanning where different scanningmethods are applied based on an intra prediction mode.

In accordance with another aspect of the present invention, there isprovided a method for encoding a moving picture based on adaptivescanning, which includes the steps of: a) selecting a prediction mode;b) predicting pixel values of pixels to be encoded of an input videobased on the selected prediction mode and outputting a residue signalblock; c) performing Discrete Cosine Transform (DCT) onto the residuesignal block and quantizing the transformed residue signal block; d)adaptively scanning the quantized residue signal block based on theprediction mode and outputting scanned coefficients; and e) encoding thescanned coefficients.

Advantageous Effects

The present invention can improve an encoding compression rateremarkably by performing intra prediction onto blocks of a predeterminedsize, and adaptively scanning coefficients acquired from Discrete CosineTransform (DCT) of a residue signal and quantization differentlyaccording to the intra prediction mode, and a method thereof.

DESCRIPTION OF DRAWINGS

The above and other objects and features of the present invention willbecome apparent from the following description of the preferredembodiments given in conjunction with the accompanying drawings, inwhich:

FIG. 1 is a view showing an intra prediction mode for 4×4 blocks and 8×8blocks in the H.264 standard;

FIG. 2 is a view describing a pixel prediction process in a verticalmode;

FIG. 3 is a view describing a pixel prediction process in a horizontalmode;

FIG. 4 is a block view illustrating a moving picture encoding apparatusin accordance with an embodiment of the present invention;

FIG. 5 is a view showing a conventional zigzag scanning;

FIG. 6 is a view showing a horizontal preference scanning in accordancewith an embodiment of the present invention;

FIG. 7 is a view showing a vertical preference scanning in accordancewith an embodiment of the present invention;

FIG. 8 is a flowchart describing a moving picture encoding method usingadaptive scanning in accordance with an embodiment of the presentinvention;

FIG. 9 is a flowchart describing an adaptive scanning in accordance withan embodiment of the present invention; and

FIG. 10 is a block view illustrating a moving picture decoding apparatusin accordance with an embodiment of the present invention.

BEST MODE FOR THE INVENTION

The following description exemplifies only the principles of the presentinvention. Even if they are not described or illustrated clearly in thepresent specification, one of ordinary skill in the art can embody theprinciples of the present invention and invent various apparatuseswithin the concept and scope of the present invention. The use of theconditional terms and embodiments presented in the present specificationare intended only to make the concept of the present inventionunderstood, and they are not limited to the embodiments and conditionsmentioned in the specification.

In addition, all the detailed description on the principles, viewpointsand embodiments and particular embodiments of the present inventionshould be understood to include structural and functional equivalents tothem. The equivalents include not only currently known equivalents butalso those to be developed in future, that is, all devices invented toperform the same function, regardless of their structures.

Functions of various devices illustrated in the drawings including afunctional block expressed as a processor or a similar concept can beprovided not only by using hardware dedicated to the functions, but alsoby using hardware capable of running proper software for the functions.When a function is provided by a processor, the function may be providedby a single dedicated processor, single shared processor, or a pluralityof individual processors, part of which can be shared.

The apparent use of a term, ‘processor’, ‘control’ or similar concept,should not be understood to exclusively refer to a piece of hardwarecapable of running software, but should be understood to include adigital signal processor (DSP), hardware, and ROM, RAM and non-volatilememory for storing software, implicatively. Other known and commonlyused hardware may be included therein, too.

Other objects and aspects of the invention will become apparent from thefollowing description of the embodiments with reference to theaccompanying drawings. When it is thought that a detailed description ofa prior art feature may obscure the points of the invention, thedescription will not be provided herein. Herein, preferred embodimentsof the present invention will be described in detail with reference tothe accompanying drawings.

FIG. 4 is a block view illustrating a moving picture encoding apparatusin accordance with an embodiment of the present invention.

As shown in FIG. 4, the moving picture encoding apparatus includes anintra predictor 110, a mode selector 120, a Discrete Cosine Transform(DCT)/quantization unit 130, and an entropy encoder 140.

The mode selector 120 selects an optimal prediction mode among theaforementioned intra prediction modes and outputs it to the intrapredictor 110. In other words, the mode selector 120 selects one amongdiverse encoding prediction modes available during 4×4 intra prediction,16×16 intra prediction and 8×8 intra prediction. Generally, it selectsone prediction mode based on rate-distortion optimization.

In case of luminance blocks, the prediction modes include a verticalmode, a horizontal mode, a DC mode, a Diagonal_Down_Left mode, aDiagonal_Down_Right mode, a Vertical_Right mode, a Horizontal_Down mode,a Vertical_Left mode, and a Horizontal_Up mode, which are intra 4×4luminance encoding modes of the H.264 standard, and a vertical mode, ahorizontal mode, a plane mode and a DC mode, which are intra 16×16luminance encoding modes.

With respect to chrominance blocks, the prediction modes include avertical mode, a horizontal mode, a plane mode and a DC mode, which areintra M×N chrominance encoding modes of the H.264 standard.

The intra predictor 110 performs prediction on an input image accordingto the prediction mode inputted from the mode predictor 120 and outputsa residue signal block which represents a difference between the pixelvalue of a macro block of a current frame to be encoded and a predictedpixel value. In the present embodiment, 4×4 intra prediction isperformed onto the pixels of a luminance block, and 8×8 intra predictionis performed onto the pixels of a chrominance block.

The DCT/quantization unit 130 performs DCT and quantization onto theresidue signal block inputted from the intra predictor 110 and outputsit to the entropy encoder 140.

The entropy encoder 140 arranges coefficients by adaptively scanning thequantized residue signal block regardless of the kind of the predictionmode, performs entropy encoding, and outputs encoded signals. Theentropy encoding is an encoding method which increases the datacompression rate by allocating a few bits to data with a high occurrencefrequency number and many bits to data with a low occurrence frequencynumber. The entropy encoding that may be applied to the presentinvention includes context adaptive variable length coding (CAVLC) andcontext-based adaptive binary arithmetic coding (CABAC).

FIG. 5 is a view describing a conventional zigzag scanning. Theconventional zigzag scanning of FIG. 5 is devised in consideration thatsignificant coefficients of the DCT are highly likely to be positionedin the left upper part. However, when the vertical mode or a horizontalmode is selected as an intra prediction mode, the correlation propertyof the residue signal may increase in a vertical or a horizontaldirection. In the case of the vertical mode, the significantcoefficients mainly appear in a first row or so. And, in the case of thehorizontal mode, the significant coefficients mainly appear in a firstcolumn or so. Therefore, another scanning method that can replace theconventional zigzag scanning is required. Hereinafter, embodiments ofadaptive scanning will be described according to the kinds of the intraprediction mode.

FIG. 6 is a view showing a horizontal preference scanning in accordancewith an embodiment of the present invention, and FIG. 7 is a viewshowing a vertical preference scanning in accordance with an embodimentof the present invention.

According to the embodiment of the present invention, the entropyencoder 140 uses the horizontal preference scanning method shown in FIG.6 when the intra prediction mode is a vertical mode. When the intraprediction mode is a horizontal mode, the entropy encoder 140 uses thevertical preference scanning method shown in FIG. 7. In the other cases,the entropy encoder 140 uses the conventional zigzag scanning, arrangescoefficients, performs entropy encoding, and outputs encoded signals.

According to the horizontal preference scanning method illustrated inFIG. 6, all the blocks of the first row are scanned and then thesubsequent scanning is performed in a sequence from all the blocks ofthe first row, followed by the first to third blocks in the second row,the second block and the first block in the third row, the first andsecond blocks in the fourth row, the third block in the third row, thefourth block in the second row, the fourth block in the third row, andthe third and fourth blocks in the fourth row. Therefore, since thehorizontal preference scanning of the present invention scans all theblocks in the first row prior to the other rows, it has a highcorrelation in the row direction and it is appropriate for the verticalmode where the significant coefficients are mainly positioned in thefirst row or so.

According to the vertical preference scanning described in FIG. 7,scanning is performed in a sequence from all the blocks in the firstcolumn first, followed by the first to third blocks in the secondcolumn, the second block and the first block in the third column, thefirst and second blocks in the fourth column, the third block in thethird column, the fourth block in the second column, the fourth block inthe third column, and the third and fourth blocks in the fourth column.Therefore, the vertical preference scanning of the present invention hasa high correlation in the column direction and it is appropriate for thevertical mode where the significant coefficients are mainly positionedin the first column or so.

Since the present invention determines the scanning method to be appliedbased on the intra mode, it scarcely affects the existing syntax and theapparatus of the present invention can be realized by applying a littlemodification to the semantics of a scanning method in the encoding anddecoding. Since those skilled in the art of a moving pictureencoding/decoding technology such as the H.264 standard can easilyrealize the adaptive scanning based on an intra prediction mode, whichis suggested in the present invention, detailed description on it willnot be provided herein.

FIG. 8 is a flowchart describing a moving picture encoding method usingadaptive scanning in accordance with an embodiment of the presentinvention.

First, when an image to be encoded is inputted to the intra predictor110 at step S510, the mode selector 120 selects an intra prediction modeat step S520.

Subsequently, the intra predictor 110 performs prediction onto theinputted image based on the selected prediction mode at step S530, andcreates a residue signal block having a difference value between a pixelvalue in a macro block of a current frame to be encoded and a predictedpixel value at step S540.

At step S550, the DCT/quantization unit 130 performs DCT onto theresidue signal block and quantizes the transformed residue signal block.

Subsequently, the entropy encoder 140 adaptively scans the quantizedresidue signal block based on the prediction mode at step S560, performsentropy encoding onto the scanned coefficients, and outputs theentropy-encoded coefficients at step S570.

FIG. 9 is a flowchart describing an adaptive scanning in accordance withan embodiment of the present invention. First, it is determined at stepS610 whether the prediction mode is a vertical mode. When it isdetermined that the prediction mode is the vertical mode, horizontalpreference scanning is performed at step S620. Meanwhile, when theprediction mode is not the vertical mode, it is determined at step S630whether the prediction mode is a horizontal mode.

When the prediction mode is the horizontal mode, vertical preferencescanning is carried out at step S640. When it is not the horizontalmode, zigzag scanning is carried out at step S650.

FIG. 10 is a block view illustrating a moving picture decoding apparatusin accordance with an embodiment of the present invention.

As illustrated in FIG. 10, the moving picture decoding apparatus of thepresent invention includes an entropy decoder 210, a scanning methoddetector 220, and an image recovery unit 230.

The entropy decoder 210 receives an encoded bitstream and decodes it byusing an entropy decoding method such as Context Adaptive VariableLength Coding (CAVLC) and Context-based Adaptive Binary ArithmeticCoding (CABAC).

The scanning method detector 220 receives the decoded signal from theentropy decoder 210, acquires information on how the decoded signal wasscanned in the encoding process, and transmits the scanning methodinformation to the image recovery unit 230 along with the decodedsignal.

The image recovery unit 230 recovers the decoded signal based on thescanning method and outputs a recovered image.

TABLE 1 News Container Foreman Silent Paris Mobile Tempete (QCIF) (QCIF)(QCIF) (QCIF) (CIF) (CIF) (CIF) Entire 100 100 100 100 100 100 100 Frame(30 Hz) (30 Hz) (30 Hz) (35 Hz) (30 Hz) (30 Hz) (30 Hz) Condition CABAC,Intra only (Intra 4 × 4 mode), QP (25, 30, 35, 40)

As shown in the Table 1, seven images of different sizes were tested.

The following Table 2 compares compression rates, when the test imagesare encoded based on the encoding method using the adaptive scanning andthe conventional encoding method using the H.264 zigzag scanning underthe aforementioned experimental conditions.

TABLE 2 JM96 Proposed Bits PSNR PSNR Reduction Image QP (dB) Bits (dB)Bits (%) Foreman 25 38.98 3341696 38.98 3321088 0.60 30 35.21 200306435.21 1990384 0.55 35 31.74 1189744 31.73 1184392 0.34 40 28.48 72241628.48 722264 0.11 News 25 40.12 3448504 40.13 3381512 1.94 30 35.952265968 35.96 2230296 1.57 35 31.99 1434256 31.99 1406384 1.94 40 28.40883904 28.42 875368 0.97 Silent 25 38.97 3621240 38.97 3601360 0.55 3034.97 2091720 34.96 2076720 0.81 35 31.56 1182280 31.56 1180416 0.16 4028.46 669544 28.46 672696 −0.38 Container 25 39.51 3287920 39.51 32605840.88 30 35.68 2058192 35.69 2029224 1.44 35 32.05 1247248 32.04 12190002.12 40 28.54 745848 28.54 730344 2.26 Paris 25 39.21 17437120 39.2017165032 1.56 30 34.99 11376816 34.99 11167040 1.84 35 31.10 707835231.11 6950384 1.84 40 27.50 4254824 27.52 4180808 1.61 Mobile 25 38.4227515248 38.42 27301888 0.80 30 33.75 18700976 33.74 18538960 0.89 3529.45 11923256 29.44 11821040 0.89 40 25.62 7179088 25.63 7126328 0.73Tempete 25 38.77 19968328 38.76 19748304 1.10 30 34.33 12766256 34.3312605288 1.25 35 30.30 7623776 30.30 7525136 1.28 40 26.73 4278568 26.744244224 0.82 Average 25 1.06 30 1.19 35 1.23 40 0.88

It can be seen from the Table 2 that the encoding compression rate usingthe adaptive scanning based on the intra prediction mode according tothe present invention is superior to the encoding compression rate usingthe H.264 zigzag scanning.

Meanwhile, a video compression standard to be developed following theH.264 standard is expected to use only the vertical, horizontal, DC, anddiagonal prediction modes, because the existing 9-directional intraprediction mode requires a considerable complexity. Therefore, theencoding method using the adaptive scanning of the present embodimentprovides even more improvement in the compression rate to thereby savebits about 3%.

Meanwhile, the moving picture encoding/decoding method described abovemay be authored in the form of a computer program. The codes and codesegments that form the program may be easily inferred by computerprogrammers of the art to which the present invention pertains. Also,the program is stored in a computer-readable recording medium and it canbe read and executed by a computer to realize the moving pictureencoding/decoding method. The data storage media include magneticrecording media, optical recording media, and carrier wave media.

While the present invention has been described with respect to certainpreferred embodiments, it will be apparent to those skilled in the artthat various changes and modifications may be made without departingfrom the scope of the invention as defined in the following claims.

What is claimed is:
 1. An encoding apparatus comprising: an intrapredictor configured to predict pixel values of pixels of an image usingan intra prediction mode, and generate a residue signal block based onthe predicted pixel values; a transform/quantization unit configured totransform and quantize the residue signal block to generate atransformed and quantized residue signal block; and an encoderconfigured to scan and encode the transformed and quantized residuesignal block based on the intra prediction mode; wherein the encoder isfurther configured to perform a horizontal scan in response to the intraprediction mode being a vertical intra prediction mode, and perform avertical scan in response to the intra prediction mode being ahorizontal intra prediction mode.
 2. The encoding apparatus of claim 1,wherein the transformed and quantized residue signal block comprises ablock of coefficients arranged in rows and columns; and the encoder isfurther configured to perform the horizontal scan by scanningcoefficients in a first row of the block of coefficients before scanningcoefficients in other rows of the block of coefficients, and perform thevertical scan by scanning coefficients in a first column of the block ofcoefficients before scanning coefficients in other columns of the blockof coefficients.
 3. The encoding apparatus of claim 1, wherein thetransformed and quantized residue signal block comprises a block ofcoefficients arranged in rows and columns; and the encoder is furtherconfigured to perform the horizontal scan by scanning all coefficientsin a first row of the block of coefficients before scanning anycoefficient in any other row of the block of coefficients, and performthe vertical scan by scanning all coefficients in a first column of theblock of coefficients before scanning any coefficient in any othercolumn of the block of coefficients.
 4. The encoding apparatus of claim1, wherein the transformed and quantized residue signal block comprisesa block of coefficients arranged in rows and columns; and the encoder isfurther configured to perform the horizontal scan by sequentiallyscanning all coefficients in a first row of the block of coefficientsfrom a first column of the block of coefficients to a last column of theblock of coefficients before scanning any coefficient in any other rowof the block of coefficients, and perform the vertical scan bysequentially scanning all coefficients in a first column of the block ofcoefficients from a first row of the block of coefficients to a last rowof the block of coefficients before scanning any coefficient in anyother column of the block of coefficients.
 5. The encoding apparatus ofclaim 1, wherein the transformed and quantized residue signal blockcomprises a block of coefficients; and the encoder is further configuredto scan the coefficients in the block of coefficients according to ascanning method selected based on the intra prediction mode, and encodethe scanned coefficients according to an entropy encoding scheme.
 6. Adecoding apparatus comprising: a decoder configured to decode an encodedbitstream to generate a decoded signal, the encoded bitstream havingbeen generated in an encoding process in which the decoded signal wasscanned according to a scanning method selected based on an intraprediction mode used in generating the decoded signal from an image; ascanning method detector configured to acquire scanning methodinformation about the scanning method; and an image recovery unitconfigured to recover the image from the decoded signal based on thescanning method information; wherein the image recovery unit is furtherconfigured to perform a horizontal scan in recovering the image from thedecoded signal in response to the scanning method information indicatingthat the intra prediction mode is a vertical intra prediction mode, andperform a vertical scan in recovering the image from the decoded signalin response to the scanning method information indicating that the intraprediction mode is a horizontal intra prediction mode.
 7. The decodingapparatus of claim 6, wherein the decoded signal comprises coefficients;and the image recovery unit is further configured to perform thehorizontal scan by scanning coefficients in a first row of a block ofthe coefficients before scanning coefficients in other rows of the blockof coefficients, and perform the vertical scan by scanning coefficientsin a first column of the block of coefficients before scanningcoefficients in other columns of the block of coefficients.
 8. Thedecoding apparatus of claim 6, wherein the decoded signal comprisescoefficients; and the image recovery unit is further configured toperform the horizontal scan by scanning all coefficients in a first rowof a block of the coefficients before scanning any coefficient in anyother row of the block of coefficients, and perform the vertical scan byscanning all coefficients in a first column of the block of coefficientsbefore scanning any coefficient in any other column of the block ofcoefficients.
 9. The decoding apparatus of claim 6, wherein the decodedsignal comprises coefficients; and the image recovery unit is furtherconfigured to perform the horizontal scan by sequentially scanning allcoefficients in a first row of a block of the coefficients from a firstcolumn of the block of coefficients to a last column of the block ofcoefficients before scanning any coefficient in any other row of theblock of coefficients, and perform the vertical scan by sequentiallyscanning all coefficients in a first column of the block of coefficientsfrom a first row of the block of coefficients to a last row of the blockof coefficients before scanning any coefficient in any other column ofthe block of coefficients.
 10. The decoding apparatus of claim 6,wherein the decoder is further configured decode the encoded bitstreamaccording to an entropy decoding scheme to generate the decoded signal.11. An encoding method comprising: predicting pixel values of pixels ofan image using an intra prediction mode; generating a residue signalblock based on the predicted pixel values; transforming and quantizingthe residue signal block to generate a transformed and quantized residuesignal block; and scanning and encoding the transformed and quantizedresidue signal block based on the intra prediction mode; wherein thescanning and encoding comprises: performing a horizontal scan inresponse to the intra prediction mode being a vertical intra predictionmode; and performing a vertical scan in response to the intra predictionmode being a horizontal intra prediction mode.
 12. The encoding methodof claim 11, wherein the transformed and quantized residue signal blockcomprises a block of coefficients arranged in rows and columns; and thescanning and encoding further comprises: performing the horizontal scanby scanning coefficients in a first row of the block of coefficientsbefore scanning coefficients in other rows of the block of coefficients;and performing the vertical scan by scanning coefficients in a firstcolumn of the block of coefficients before scanning coefficients inother columns of the block of coefficients.
 13. The encoding method ofclaim 11, wherein the transformed and quantized residue signal blockcomprises a block of coefficients arranged in rows and columns; and thescanning and encoding further comprises: performing the horizontal scanby scanning all coefficients in a first row of the block of coefficientsbefore scanning any coefficient in any other row of the block ofcoefficients; and performing the vertical scan by scanning allcoefficients in a first column of the block of coefficients beforescanning any coefficient in any other column of the block ofcoefficients.
 14. The encoding method of claim 11, wherein thetransformed and quantized residue signal block comprises a block ofcoefficients arranged in rows and columns; and the scanning and encodingfurther comprises: performing the horizontal scan by sequentiallyscanning all coefficients in a first row of the block of coefficientsfrom a first column of the block of coefficients to a last column of theblock of coefficients before scanning any coefficient in any other rowof the block of coefficients; and performing the vertical scan bysequentially scanning all coefficients in a first column of the block ofcoefficients from a first row of the block of coefficients to a last rowof the block of coefficients before scanning any coefficient in anyother column of the block of coefficients.
 15. The encoding method ofclaim 11, wherein the transformed and quantized residue signal blockcomprises a block of coefficients; and the scanning and encoding furthercomprises: scanning the coefficients in the block of coefficientsaccording to a scanning method selected based on the intra predictionmode; and encoding the scanned coefficients according to an entropyencoding scheme.
 16. A decoding method comprising: decoding an encodedbitstream to generate a decoded signal, the encoded bitstream havingbeen generated in an encoding process in which the decoded signal wasscanned according to a scanning method selected based on an intraprediction mode used in generating the decoded signal from an image;acquiring scanning method information about the scanning method; andrecovering the image from the decoded signal based on the scanningmethod information; wherein the recovering of the image comprises:performing a horizontal scan in recovering the image from the decodedsignal in response to the scanning method information indicating thatthe intra prediction mode is a vertical intra prediction mode; andperforming a vertical scan in recovering the image from the decodedsignal in response to the scanning method information indicating thatthe intra prediction mode is a horizontal intra prediction mode.
 17. Thedecoding method of claim 16, wherein the decoded signal comprisescoefficients; and the recovering of the image further comprises:performing the horizontal scan by scanning coefficients in a first rowof a block of the coefficients before scanning coefficients in otherrows of the block of coefficients; and performing the vertical scan byscanning coefficients in a first column of the block of coefficientsbefore scanning coefficients in other columns of the block ofcoefficients.
 18. The decoding method of claim 16, wherein the decodedsignal comprises coefficients; and the recovering of the image furthercomprises: performing the horizontal scan by scanning all coefficientsin a first row of a block of the coefficients before scanning anycoefficient in any other row of the block of coefficients; andperforming the vertical scan by scanning all coefficients in a firstcolumn of the block of coefficients before scanning any coefficient inany other column of the block of coefficients.
 19. The decoding methodof claim 16, wherein the decoded signal comprises coefficients; and therecovering of the image further comprises: performing the horizontalscan by sequentially scanning all coefficients in a first row of a blockof the coefficients from a first column of the block of coefficients toa last column of the block of coefficients before scanning anycoefficient in any other row of the block of coefficients; andperforming the vertical scan by sequentially scanning all coefficientsin a first column of the block of coefficients from a first row of theblock of coefficients to a last row of the block of coefficients beforescanning any coefficient in any other column of the block ofcoefficients.
 20. The decoding method of claim 16, wherein the decodingof the encoded bitstream comprises decoding the encoded bitstreamaccording to an entropy decoding scheme to generate the decoded signal.